# 随机生成两个1000以内的不同的整数,计算两个数之间的质数之和
# 打印乘法口诀表


import math


def input_num():
    try:
        return int(input("输入数字:"))
    except:
        print("非法数字")
        input_num()


def is_prime(num: int):
    for i in range(2, int(math.sqrt(num) + 1)):
        if num % i == 0:
            return False
    return True


def get_prime_sum():
    num1 = input_num()
    num2 = input_num()
    _sum = 0
    if num1 == num2:
        print("两个数一致,中间没有质数")
        get_prime_sum()
    elif num1 < num2:
        for i in range(num1 + 1, num2):
            if is_prime(i):
                _sum += i
    else:
        for i in range(num1, num2, -1):
            if is_prime(i):
                _sum += i
    print("%d和%d之间的质数和为: %d" % (num1, num2, _sum))


def multiple_fun():
    num1 = 1
    num2 = 1
    for i in range(1, 10, 1):
        for j in range(1, i + 1):
            print(f'{j}X{i}={i * j}\t', end='')
        print()


if __name__ == '__main__':
    # get_prime_sum()
    multiple_fun()
